<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/taglibs.jsp"%>
<html>
<s:head />
<body>

<!-- 月历 -->
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick-zh-CN.js"></script>
<script src="/js/jquery.tooltip.min.js" type="text/javascript"></script>

<link rel="stylesheet" href="/css/jquery.tooltip.css" />
<link rel="stylesheet" type="text/css" href="/css/smoothness.datepick.css" />
<link rel="stylesheet" type="text/css" href="/css/validator.css" />
<script language="javascript">
	$().ready( function() {
		$('#tradeStartDtStParam').datepick({minDate: new Date(${minDate}), maxDate:new Date(${today}),showOn:'both',dateFormat:"yy-mm-dd"}); 
		$('#tradeStartDtEdParam').datepick({minDate: new Date(${minDate}), maxDate:new Date(${today}),beforeShow:customRange,showOn: 'both',dateFormat:"yy-mm-dd"});
	});
	function customRange (){
		var startDt = $('#tradeStartDtStParam').val(); //起始日
		var endDt = new Date(parseInt(startDt.substring(0,4),10),parseInt(startDt.substring(5,7),10)-1,parseInt(startDt.substring(8,10),10)); //結束日
		return {minDate:endDt,maxDate: new Date(${today})}; 
	}
			
</script>
<s:actionerror />
<s:actionmessage />
<s:fielderror />
<h1>第三方支付管理</h1>
<div class="data-form"><s:form action="query.do" method="post">
	<b>交易流水号：</b>
	<input name="idParam" type="text" id="idParam"
		value="${dParam}" size="20" maxlength="20">
	<b>交易日期：</b>
	<input name="tradeStartDtStParam" type="text" id="tradeStartDtStParam"
		value="${tradeStartDtStParam}" size="10" maxlength="10">
    ~ <input name="tradeStartDtEdParam" type="text" id="tradeStartDtEdParam"
		value="${tradeStartDtEdParam}" size="10" maxlength="10">
	<b>订单编号：</b><input type=text value="${orderIdParam}" name="orderIdParam" size="20" maxlength="18">
	<input type="button" value="搜寻" onClick="this.form.submit();" />
</s:form></div>
<br />
<s:if test="thirdPartyList.size > 0">
	<yaodian100:pageutil link="search.do" pagerObj="${pager}" />
	<table class="tb-1" width="100%">
		<thead>
			<tr>
				<th>交易流水号</th>
				<th>订单编号</th>
				<th>第三方支付编号</th>
				<th>使用者名称</th>
				<th>金额</th>
				<th>交易回覆码</th>
				<th>支付商家</th>
				<th>送出时间</th>
				<th>回传时间</th>
				<th>功能</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${thirdPartyList}" var="thirdParty" varStatus="rows_index">
				<tr class="${rows_index.count % 2 == 0 ? 'bg-yl' : ''} tdDesc" id="tdDesc" 
				title="订单编号:${thirdParty.orderId}">
					<td><a href="view.do?tppId=${thirdParty.id}" />${thirdParty.id}</a></td>
					<td>${thirdParty.orderId}</td>
					<td>${thirdParty.tid}</td>
					<td>${thirdParty.userName}</td>
					<td>${thirdParty.amount}</td>
					<td>${thirdParty.result}</td>
					<td>${srcMenu.options[thirdParty.src].name}</td>
					<td><fmt:formatDate value="${thirdParty.tradeStartDt}" pattern="yyyy/MM/dd HH:mm:ss" /></td>
					<td><fmt:formatDate value="${thirdParty.tradeEndDt}" pattern="yyyy/MM/dd HH:mm:ss" /></td>
					<td><a href="view.do?tppId=${thirdParty.id}" />详细</a></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<yaodian100:pageutil link="query.do" pagerObj="${pager}" />
</s:if>
</body>
</html>
